'''
Created on Mar 21, 2013

@author: cat
'''

class ExerciseRecord():
    #ID of RFID tag first time 
    tag_id = ""
    #Recording the time when reader first time read tag_ID
    start_time = 0.0
    #last checkpoint
    last_point = ""
    #Recording the time when reader last time read tag_ID
    last_time = 0.0
    run_distance = 0
    run_duration = 0.0 
    walk_distance = 0
    walk_duration = 0.0
    weight = 0.0
    kcal = 0.0
    value = 0
    group_count = 0

    def __init__(self):
        pass
    def __str__(self):
        return "%s, %s, %s, %s, %s, %s" %(self.tag_id, self.start_time, self.last_point, self.last_time, 
                                          self.run_distance+self.walk_distance, self.run_duration+self.walk_duration)
    def __repr__(self):
        return self.run_distance
        
#reader
class RawDataRecord:
    def __init__(self, tid, t):
        self.tag_id = tid
        self.current_time = t
    #tag_id = ""
    #current_time = 0.0
    
class UserInfo:
    #sid = ""
    #name = ""
    #weight = 0.0
    #email = ""
    #cur_run = 0
    #cur_walk = 0
    #total_run = 0
    #total_walk = 0
    #last_week = 0
    #cur_week = 0
    #total_week = 0
    modified = False
    
    SID = 0
    NAME = 1
    WEIGHT = 2
    EMAIL = 3
    TAGID = 4
    CUR_RUN = 5
    CUR_WALK = 6
    TOTAL_RUN = 7
    TOTAL_WALK = 8
    LAST_WEEK = 9
    CUR_WEEK = 10
    TOTAL_WEEK = 11
    
    def __init__(self, sid, name, weight, email, crun, cwalk, trun, twalk, lweek, cweek, tweek):
        self.sid = sid
        self.name = name
        self.weight = weight
        self.email = email
        self.cur_run = crun
        self.cur_walk = cwalk
        self.total_run = trun
        self.total_walk = twalk
        self.last_week = lweek
        self.cur_week = cweek
        self.total_week = tweek
    
